package com.core.zyyz.util;

import org.apache.commons.lang3.StringUtils;

public class BooleanUtil {
    private static final String[] TRUE_STRINGS = new String[]{"1", "y", "true"};

    private BooleanUtil() {
    }

    public static boolean isTrue(String flag) {
        if (StringUtils.isBlank(flag)) {
            return false;
        } else {
            flag = flag.trim();
            String[] var1 = TRUE_STRINGS;
            int var2 = var1.length;

            for(int var3 = 0; var3 < var2; ++var3) {
                String trueString = var1[var3];
                if (trueString.equalsIgnoreCase(flag)) {
                    return true;
                }
            }

            return false;
        }
    }

    public static boolean isFalse(String flag) {
        return !isTrue(flag);
    }

    public static String parseToString(boolean flag) {
        return flag ? "1" : "0";
    }
}